package com.local.indexconfig.feign;

import com.local.common.util.ResultUtil;
import com.local.indexconfig.pojo.IndexConfigDeleteRequestParam;
import com.local.indexconfig.pojo.IndexConfig;
import com.local.indexconfig.pojo.IndexConfigListRequestParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("indexconfigservice")
public interface IndexConfigServiceFeign {

    /**
     * 获取配置商品列表，支持翻页
     * @param indexConfigListRequestParam
     * @return
     */
    @GetMapping("/indexconfig/list")
    @ResponseBody
    public ResultUtil list(@RequestBody IndexConfigListRequestParam indexConfigListRequestParam);

    /**
     * 新增
     * @param indexConfig
     * @return
     */
    @PostMapping("/indexconfig/save")
    @ResponseBody
    public ResultUtil save(@RequestBody IndexConfig indexConfig);

    /**
     * 修改
     * @return
     */
    @PostMapping("/indexconfig/update")
    @ResponseBody
    public ResultUtil update(@RequestBody IndexConfig indexConfig);

    /**
     * 根据id删除，支持批量删除
     * @param indexConfigDeleteRequestParam
     * @return
     */
    @PostMapping("/indexconfig/delete")
    @ResponseBody
    public ResultUtil delete(@RequestBody IndexConfigDeleteRequestParam indexConfigDeleteRequestParam);

    /**
     * 查询首页各部分推荐商品的列表
     * @param configType
     * @param number
     * @return
     */
    @GetMapping("/indexconfig/listconfigtype/{configType}/{number}")
    @ResponseBody
    public ResultUtil<List<IndexConfig>> getListByConfigType(@PathVariable("configType") Integer configType, @PathVariable("number") Integer number);

}
